package io.gitee.zhangbinhub.acp.boot

import io.gitee.zhangbinhub.acp.boot.conf.AcpCorsConfiguration
import io.gitee.zhangbinhub.acp.boot.conf.AcpScheduleConfiguration
import io.gitee.zhangbinhub.acp.boot.conf.AcpTcpServerConfiguration
import io.gitee.zhangbinhub.acp.boot.conf.AcpUdpServerConfiguration
import org.springframework.boot.autoconfigure.AutoConfiguration
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.jackson.JacksonProperties
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean

/**
 * @since JDK 17
 */
@AutoConfiguration
@EnableConfigurationProperties(
    AcpCorsConfiguration::class,
    AcpScheduleConfiguration::class,
    AcpTcpServerConfiguration::class,
    AcpUdpServerConfiguration::class
)
class AcpPropertiesAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(JacksonProperties::class)
    fun jacksonProperties() = JacksonProperties()

}